package daobeauty.interceptor.returntype.executor.sqlquery;

import org.hibernate.SQLQuery;

import daobeauty.dao.Limiting;
import daobeauty.interceptor.returntype.handler.ReturnTypeHandler;

/**
 * This interface defines a strategy for executing SQLQueries.
 * The given ReturnTypeHandler is responsible of converting the result of the query
 * to the type, which the proxied method has to return.
 * Also the Limiting has to be applied to the SQLQuery.<br/>
 * Different execution strategies may consist of calling SQLQuery.list(), SQLQuery.uniqueResult() or SQLQuery.scroll().<br/>
 * SQLQueries don't support additional sorting outside of the defined SQL-query.
 * 
 * @author M. Serhat Cinar
 * @see ReturnTypeHandler
 * @see SQLQuery
 * @see Limiting
 *
 */
public interface SqlQueryExecutionStrategy {
	public Object execute(ReturnTypeHandler returnTypeHandler, SQLQuery query, Limiting limiting);
}
